/*
 * @lc app=leetcode.cn id=1446 lang=javascript
 *
 * [1446] 连续字符
 */

// @lc code=start
/**
 * @param {string} s
 * @return {number}
 */
var maxPower = function (s) {
  let len = s.length;
  let max = 0;

  for (let i = 0; i < len; i++) {
    let count = 1;
    let j = i + 1;
    while (j < len && s[j] === s[i]) {
      count++;
      j++;
    }
    max = Math.max(max, count);
  }

  return max;
};
// @lc code=end
